Skip to main content

Refund Order


POST /api/integrator/order/refund/v2

This POST method is used to refund an order in the Keepz system.

⚠️ Important restriction: An order can only be refunded if:

  • Its current status in the Keepz system is SUCCESS, PARTIALLY_REFUNDED, or REFUNDED_FAILED.
  • The integrator has refund functionality configured by Keepz.

Refunds are not possible if the order is in any other state.

Request details

When sending request to Keepz, these four parameters must always be included in the body:

identifier

  • Unique ID of the integrator in the Keepz system.
  • Provided by Keepz during the integration process.

encryptedData

  • Contains the actual request payload encrypted using a randomly generated symmetric key and IV (Initialization Vector).

encryptedKeys

  • Contains the AES key and IV used to encrypt encryptedData.

aes

  • Boolean flag indicating that the request uses AES-based symmetric encryption (needed for backward compatibility with older encryption methods).

For details on the encryption process, see the Encryption Guide documentation.

Parameters

The following parameters form the actual refund payload. They must be included inside the encryptedData parameter, which is encrypted and passed in the request as shown above.

ParameterTypeRequiredDescriptionPossible valuesNote
integratorIdstring (UUID v4)Unique ID of the integrator in the Keepz system. Provided by a Keepz representative.
integratorOrderIdstring (UUID v4)Unique identifier of the order in the integrator’s system.
amountnumber / decimalRefund amount to be returned to the payer.Positive decimalMust be ≤ original transaction amount.
refundInitiatorstringSpecifies who is initiating the refund.INTEGRATOR, OPERATOR
refundDetailsarray of objectsOptional detailed breakdown of the refund. Each object represents a specific recipient and the portion of the refund allocated to them. Useful for splitting a refund among multiple beneficiaries when the original payment was split.Details are provided in the dedicated section below.

Complex Types Description

refundDetails

Each object in the array represents one recipient and contains:

ParameterTypeRequiredDescriptionPossible valuesNote
receiverTypestringType of recipient in the Keepz system.BRANCH, USER, IBANBRANCH – a registered branch in Keepz. USER – a registered user in Keepz. IBAN – an external IBAN account (not registered in Keepz).
receiverIdentifierstringUnique identifier of the recipient.For BRANCH and USER, this is a UUID provided by Keepz. For IBAN, this is the IBAN number.
amountnumberAmount to refund to this recipient.Must be greater than 0.

Response details

✅ Success Response

If the refund request is valid, the API returns an encrypted payload:

{
"encryptedData": "string",
"encryptedKeys": "string",
"aes": true
}

encryptedData

  • Contains the actual response payload encrypted using a randomly generated symmetric key and IV (Initialization Vector).

encryptedKeys

  • Contains the AES key and IV used to encrypt encryptedData.

aes

  • Boolean flag indicating that the request uses AES-based symmetric encryption (needed for backward compatibility with older encryption methods).

For details on the decryption process, see the Encryption Guide documentation.

Inside encryptedData, the following parameters are available after decryption:

ParameterTypePossible ValuesDescription
integratorOrderIdstring(UUID v4)Unique identifier of the order in the integrator’s system.
statusstringREFUND_REQUESTEDAlways returned immediately after refund is initiated.

⚠️ The final refund result is processed asynchronously. To check whether the refund was successfully completed ( REFUNDED_BY_INTEGRATOR, PARTIALLY_REFUNDED, REFUNDED_FAILED), use the Get Order Status endpoint.

❌ Error Response

If an error occurs, the response is returned without encryption (plain JSON):

{
"message": "You can't refund order: Order is already fully refunded",
"statusCode": 6005,
"exceptionGroup": 5
}
ParameterTypeDescription
messagestringError message. Details are provided in the dedicated section below.
statusCodenumberError status code. Details are provided in the dedicated section below.
exceptionGroupnumberError group. Details are provided in the dedicated section below.

Details can be found at Error Code Description.